package com.dhl.composite;

import javax.lang.model.element.VariableElement;

/**
 * @title: Client
 * @Author danghailiang
 * @Date: 2022/8/8 22:27
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        // 创建根节点
        OrganizationComponent university = new University("新疆理工学院", "马马虎虎二本");
        // 创建二级节点
        OrganizationComponent college = new College("信息技术学院", "全是汉子");
        OrganizationComponent college2 = new College("中国语言学院", "全是么子");
        // 创建三级节点---叶子节点
        OrganizationComponent department = new Department("科学技术学院", "及其牛逼的专业");
        OrganizationComponent department2 = new Department("软件工程学院", "稍微厉害的");
        OrganizationComponent department3 = new Department("小学教师", "全是小姐姐");
        // 添加二级节点
        university.add(college);
        university.add(college2);
        // 添加一级节点---叶子节点
        college.add(department);
        college.add(department2);
        // 添加一级节点---叶子节点
        college2.add(department3);
        // 打印
        university.print();
    }
}
